package com.yuandian.business.monitor.controller;

import com.yuandian.api.business_monitor.po.UserActionDetailParams;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.business.monitor.service.IUserActionDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liXin
 * @description 用户操作详情
 * @date 2021/12/6
 */
@RestController
@Api(value = "userOperationsDetail", tags = "用户操作回溯分析详情")
@RequestMapping("/analysis/userActionBacktracking/userActionDetail")
public class UserActionDetailController {

    @Autowired
	IUserActionDetailService userActionDetailService;

    /**
     * 获取用户操作详情
     * @return
     */
	@ApiImplicitParams({
			@ApiImplicitParam(name = "endTime", 			value = "结束时间", 			paramType = "query", 	required = true, 	dataType = "String"),
			@ApiImplicitParam(name = "startTime", value = "开始时间", 			paramType = "query", 	required = false, 	dataType = "Long"),
			@ApiImplicitParam(name = "businessDetailId",   			value = "详单id", 				paramType = "query", 	required = true, 	dataType = "String"),
	})
    @PostMapping("/queryUserActionDetail")
	@ApiOperation("用户操作详情-获取用户操作详情")
    public R queryUserActionDetail(@RequestBody UserActionDetailParams params){
        return R.ok(userActionDetailService.queryUserActionDetail(params));
    }

    /**
     * 用户操作业务步骤列表
     * @return
     */
	@ApiImplicitParams({
			@ApiImplicitParam(name = "endTime", 			value = "结束时间", 			paramType = "query", 	required = true, 	dataType = "String"),
			@ApiImplicitParam(name = "startTime", value = "开始时间", 			paramType = "query", 	required = false, 	dataType = "Long"),
			@ApiImplicitParam(name = "businessDetailId",   			value = "详单id", 				paramType = "query", 	required = true, 	dataType = "String"),
	})
    @PostMapping("/queryUserActionBusiStepList")
	@ApiOperation("用户操作详情-用户操作业务步骤列表")
    public R queryUserActionBusiStepList(@RequestBody  UserActionDetailParams params){
        return R.ok(userActionDetailService.queryUserActionBusiStepList(params));
    }


}
